<div class="main-container" #wrap>
    <div class="main-title">
        {{planName}}{{pageType === 'view' ? '详情' : '修改'}}

    </div>
    <div class="main-content">
        <div class="content-top-bar">
            <div class="compare-tips">( 黄委会计划指标：<b class="height-light blue-text"> {{hwPlanData}}m³/s</b> 当前平均日流量： <b class="height-light blue-text"><span class="blue-text">{{dispatchService.sumSltData(argDayList)}} m³/s</span></b> 与指标对比：
                <span *ngIf="yearOnYear;else zeroTmp" [ngClass]="yearOnYear>0?'inc':'dec'">{{yearOnYear>0?"超":"少"}}<b class="height-light">{{yearOnYear | mathAbs}} m³/s</b></span>
                <ng-template #zeroTmp>无增减</ng-template>
                )</div>
            <div class="rf table-btn-group">
                <button *ngIf="pageType!='view'" nz-button nzType="primary" (click)="submitEvent()">保存</button>
                <button *ngIf="pageType!='view'" nz-button nzType="primary" (click)="submitEvent('centerAudit')">下发</button>
                <button nz-button nzType="primary" (click)="goBack()">返回</button>
            </div>
        </div>

        <div class="table-content dark-blue-table">
            <nz-table #editableTable nzBordered [nzData]="valList" [nzLoading]="loading" [nzWidthConfig]="widthConfig" [nzScroll]="scrollConfig" [nzFrontPagination]="false" nzSize="middle">
                <thead>
                    <tr>
                        <th rowspan="2" nzLeft="0px">日期</th>
                        <th rowspan="2">合计</th>
                        <th rowspan="2">唐徕渠</th>
                        <th rowspan="2">汉延渠</th>
                        <th rowspan="2">惠农渠</th>
                        <th rowspan="2">西干渠</th>
                        <th colspan="2">渠首各渠</th>
                        <th rowspan="2">
                            河东总干 <br/>（秦汉马莲）
                        </th>
                        <th rowspan="2">东干渠</th>
                        <th rowspan="2">七星渠</th>
                        <th rowspan="2">跃进渠</th>
                        <th rowspan="2">沙坡头<br/>各干渠</th>
                        <th colspan="3">固海扬水</th>
                        <th rowspan="2">红寺堡<br/>扬水</th>
                        <th rowspan="2">盐环定<br/>扬水</th>
                        <th rowspan="2">黄河水源<br/>泵站</th>
                        <!-- <th rowspan="2" >操作</th> -->
                    </tr>
                    <tr>
                        <th> 大清渠<br/>泰民渠 </th>
                        <th> 总干渠<br/>直开口 </th>
                        <th> 泉眼山 </th>
                        <th> 大战场 </th>
                        <th> 固扩 </th>
                    </tr>
                    <tr class="height-light-header">
                        <th>流量合计(m³/s)</th>
                        <th> {{dispatchService.sumSltData(valTotalList)}} </th>
                        <th *ngFor="let val of valTotalList">{{val}}</th>
                        <!-- <th>\</th> -->
                    </tr>
                    <tr class="height-light-header">
                        <th>平均日流量(m³/s)</th>
                        <th> {{dispatchService.sumSltData(argDayList)}} </th>
                        <th *ngFor="let val of argDayList">{{val}}</th>
                        <!-- <th>\</th> -->
                    </tr>
                    <tr class="height-light-header">
                        <th>水量合计(万m³)</th>
                        <th> {{dispatchService.sumSltData(waterTotalList)}} </th>
                        <th *ngFor="let val of waterTotalList">{{val}}</th>
                        <!-- <th>\</th> -->
                    </tr>
                    <tr class="height-light-header">
                        <th>上报数据</th>
                        <th> {{dispatchService.sumSltData(manageDataList[currentIndex])}} </th>
                        <th *ngFor="let val of manageDataList[currentIndex]">{{val}}</th>
                        <!-- <th>\</th> -->
                    </tr>
                    <tr class="height-light-header">
                        <th>三年平均</th>
                        <th> {{dispatchService.sumSltData(argThreeYearsList[currentIndex])}} </th>
                        <th *ngFor="let val of argThreeYearsList[currentIndex]">{{val}}</th>
                        <!-- <th>\</th> -->
                    </tr>
                </thead>
                <tbody>
                    <!-- 中心下发数据 -->
                    <tr [class]="{'act':currentIndex===i}" *ngFor="let dayList of editableTable.data;let i = index" (click)="startEdit(i,$event)">

                        <td nzLeft="0px">{{dateHeadList[i]}}</td>

                        <td>{{dayList.total}}</td>

                        <td *ngFor="let key of keyList">
                            <div *ngIf="!isEditableTd(i); else inputTpl">
                                <div class="editable-cell-value-wrap">
                                    {{dayList[key]}}
                                </div>
                            </div>
                            <ng-template #inputTpl>
                                <input type="text" nz-input [(ngModel)]="dayList[key]" />
                            </ng-template>
                        </td>

                        <!-- <td>\</td> -->
                    </tr>
                </tbody>
            </nz-table>
        </div>
    </div>
</div>
